<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head>
<title>addMessage</title>
</head>
<body>
<?php if (isset($_POST['submitted'])) {
//form submit code here
$_POST['ip']=$_SERVER['REMOTE_ADDR'];
unset($_POST['submitted']);
$m=new Message();
$m[]=$_POST;
?>
return <a href="./index.html" >home</a>
<?php
} else { 
?>
<form method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">
<label for="title" >title</label><input type="text" name="title" /><br>
<label for="body" >body</label><textarea name="body" rows="10"  cols="150"></textarea><br>
<label for="name" >username</label><input type="text" name="name" /><br>
<label for="url" >userhomepage</label><input type="text" name="url" /><br>
<label for="mail" >usermail</label><input type="text" name="mail" /><br>
<input type="submit" name="submitted" value="addmessage"></form>
<?php } // end of form ?>
</body>
